<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>facebook分享</title>
</head>
<body>
<script>
    /*
     * 加载facebook分享的js (放在body标签后)
     */
    window.fbAsyncInit = function () {
        FB.init({
            appId: '603513066495231',
            xfbml: true,
            version: 'v2.7'
        });
    };
    (function(d, s, id){
        var js, fjs = d.getElementsByTagName(s)[0];
        if (d.getElementById(id)) {return;}
        js = d.createElement(s); js.id = id;
        js.src = "//connect.facebook.net/en_US/sdk.js";
        fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));

</script>
<h2>facebook分享</h2>
<div id="shareBtn" style="display: block; width:115px; padding:10px; text-align: center; background-color: #00a0df; color:#fff;" >facebook Share</div>

<script>
    /*
     * facebook的分享调用
     */
    document.getElementById('shareBtn').onclick = function() {
        FB.ui({
            method: 'share',
            display: 'popup',
            href: 'http://yiyuan.9ebo.com/share/share.html'  //分享页面地址
        }, function (response){
            //console.log(response);
        });
    }

</script>
</body>
</html>